﻿@using FCTC_Web.Models
@model FCTC_Web.Utilities.Page<Article>

@{
    ViewBag.Title = "Index";
}

<h2>文章列表</h2>
<style>
    table tr th
    {
        padding: 0px 15px;
        text-align: center;
        line-height: 30px;
    }
    table tr td
    {
        text-align: center;
    }
</style>
<p>
    @Html.ActionLink("创建", "Create")
</p>
<table>
    <tr>
        <th>
            文章标题
        </th>
        <th>
            来源
        </th>
        <th>
            新闻类型
        </th>
        <th>
            完成时间
        </th>
        <th>
            关键字
        </th>
        <th>
            编辑时间
        </th>
        <th>
            编辑人
        </th>
         <th>
            图片(张)
        </th>
        <th>操作</th>
    </tr>

@foreach (var item in Model.CurrentRecords) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.HeadLine)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.From)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ArticleType)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ReportingTime)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Keyword)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.UpdateTime)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.UpdatedUser)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Imgs.Count)
        </td>
        <td>
            @Html.ActionLink("编辑", "Edit", new { id=item.ID }) |
             @Html.ActionLink("编辑文章图片列表", "IndexForArticle", "Image", new { relativeId = item.ID }, null)|
            @Html.ActionLink("详细信息", "Details", new { id=item.ID })
             @if (item.Imgs != null && item.Imgs.Count == 0)
             {
                    <span>|</span>
                    @Html.ActionLink("删除", "Delete", new { id = item.ID })
             }
        </td>
    </tr>
}

</table>
@Html.Pager(Model, "/Article/Index")